// 攻略详情页面
import request from '../request/request';


 // 获取用户收藏/点赞数据
export const fetchCollectData = (user_id, type = 3) => {
  return request({
    url: '/Collect/index',
    method: 'post',
    data: { user_id, type },
  });
};


// 获取评论列表
export const fetchCommentList = (intri_id) => {
  return request({
    url: '/Introcom/index',
    method: 'post',
    data: { intri_id },
  });
};

// 获取攻略列表
export const fetchStrategyList = (scenic_id) => {
  return request({
    url: '/intro/index',
    method: 'post',
    data: { scenic_id },
  });
};

// 点赞/取消点赞
export const toggleLike = (user_id, intro_id) => {
  return request({
    url: '/Collect/add',
    method: 'post',
    data: { user_id, type: 3, intro_id },
  });
};

// 收藏/取消收藏
export const toggleCollect = (user_id, intro_id) => {
  return request({
    url: '/Collect/add',
    method: 'post',
    data: { user_id, type: 1, intro_id },
  });
};